//
//  YDOAApplyListViewController.swift
//  YDOAProduct
//
//  Created by YDWY on 2017/6/6.
//  Copyright © 2017年 Allen. All rights reserved.
//

import UIKit

class YDOAApplyListViewController: UIViewController {

    var dataSoure : Array = Array<ApplyModel>()
    
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        
        self.title = "物资申请确认单"
        
        
        
        let scrollView = UIScrollView(frame: CGRect(x: 0, y: 64, width: ScreenWidth, height: ScreenHeight - 130))
        scrollView.backgroundColor = UIColor.white

        let userLab = UILabel.ym_lable(text: "申请人：曾诚", fontSize: 15, color: .black)
        userLab.frame = CGRect(x: 30, y: 20, width: ScreenWidth - 80, height: 21)
        scrollView.addSubview(userLab)
        
        
        let branchLab = UILabel.ym_lable(text: "申请部门: 信息中心", fontSize: 15, color: .black)
        branchLab.frame = CGRect(x: 30, y:userLab.ym_bottomY + 8 , width: ScreenWidth - 80, height: 21)
        scrollView.addSubview(branchLab)
        
        
        let goodsLab = UILabel.ym_lable(text: "申请物品：", fontSize: 15, color: .black)
        goodsLab.frame = CGRect(x: 30, y:branchLab.ym_bottomY + 8 , width: ScreenWidth - 80, height: 21)
        scrollView.addSubview(goodsLab)
        
       
        
        
        for i in 0..<dataSoure.count {
            let model = dataSoure[i]
            let branchLab = UILabel.ym_lable(text: "\(model.name)\(model.applyNum)", fontSize: 15, color: .black)
            branchLab.frame = CGRect(x: 130, y:goodsLab.ym_bottomY + 30.0 * CGFloat(i)  , width: ScreenWidth - 80, height: 21)
            scrollView.addSubview(branchLab)
        }
        
         scrollView.contentSize = CGSize(width: ScreenWidth, height: 57.0 + 30.0 * CGFloat(dataSoure.count))
        
        view.addSubview(scrollView)
        
        
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
       
    }
    
    //MARK : -
    //MARK : 确认申请按钮点击
    @IBAction func sureBtnClick(_ sender: Any) {
        
        navigationController?.pushViewController(YDOASucceedVC(), animated: true)
    }

   
}
